<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@include file="common.jsp" %>
 <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                 <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-cf">商品管理列表</div>
                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a href="${pageContext.request.contextPath}/adminGM/toAdd.shtml"><button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span>上架商品</button></a>
                                                <a href="${pageContext.request.contextPath}/adminGM/goodsList.shtml"><button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 查询所有商品</button></a> 
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                  <form action="${pageContext.request.contextPath}/adminGM/merchantsList.shtml" method="post">
                                 <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" name="shopName" placeholder="根据商家名称查询"class="am-form-field ">
                                        <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="submit"></button>
          </span>
                                    </div>
                                </div>
                                </form>
                                <form action="${pageContext.request.contextPath}/adminGM/goodsList.shtml" method="post">
                                 <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" name="goodsName" placeholder="根据商品标题查询"class="am-form-field ">
                                        <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="submit"></button>
          </span>
                                    </div>
                                </div>
                                </form>
								<form action="${pageContext.request.contextPath}/adminGM/goodsList.shtml" method="post">
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" name="id" placeholder="根据商品编号查询" class="am-form-field ">
                                        <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="submit"></button>
          </span>
                                    </div>
                                </div>
								</form>
                                <div class="am-u-sm-12">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                        <thead>
                                            <tr>
                                                <th>商家ID</th>
                                                <th>商家真实姓名</th>
                                                <th>商铺名字</th>
                                                <th>保证金</th>
                                                <th>商家用户id</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                         <c:forEach items="${merchantsList}" var="item">
                                            <tr class="gradeX">
                                                <td class="am-text-middle"><a href="${pageContext.request.contextPath}/adminGM/goodsList.shtml?merchantId=${item.id}">${item.id}</a></td>
                                                <td class="am-text-middle"><a href="${pageContext.request.contextPath}/adminGM/goodsList.shtml?merchantId=${item.id}">${item.shopkeeper}</a></td>
                                                <td class="am-text-middle"><a href="${pageContext.request.contextPath}/adminGM/goodsList.shtml?merchantId=${item.id}">${item.shopName}</a></td>
                                                <td class="am-text-middle"><a href="${pageContext.request.contextPath}/adminGM/goodsList.shtml?merchantId=${item.id}">${item.cashDeposit}</a></td>
                                                <td class="am-text-middle"><a href="${pageContext.request.contextPath}/adminGM/goodsList.shtml?merchantId=${item.id}">${item.uId}</a></td>
                                            </tr>
                                            </c:forEach>
                                            <!-- more data -->
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                        	
                                        	<!-- 上一页 -->
                                        	<c:choose>
                                        		<c:when test="${ pageHelper.currentPageIndex == 1}">
                                        			<li class="am-disabled"><a href="${pageContext.request.contextPath}/adminGM/merchantsList.shtml?pageIndex=${pageHelper.currentPageIndex-1}&shopName=${shopName}">«</a></li>
                                        		</c:when>
                                        		<c:otherwise>
                                        			<li><a href="${pageContext.request.contextPath}/adminGM/merchantsList.shtml?pageIndex=${pageHelper.currentPageIndex-1}&shopName=${shopName}">«</a></li>
                                        		</c:otherwise>
                                        	</c:choose>
                                            
                                            <!-- 页码 -->
                                             <c:forEach items="${pageHelper.pageNumList }" var="item">
                                             		<c:if test="${ pageHelper.currentPageIndex == item}">
                                             			<li class="am-active"><a href="${pageContext.request.contextPath}/adminGM/merchantsList.shtml?pageIndex=${item}&shopName=${shopName}">${item}</a></li>
                                             		</c:if>
                                             		<c:if test="${ pageHelper.currentPageIndex != item}">
                                             			<li><a href="${pageContext.request.contextPath}/adminGM/merchantsList.shtml?pageIndex=${item}&shopName=${shopName}">${item}</a></li>
                                             		</c:if>
										        </c:forEach>
										        
										        <!-- 下一页 -->
                                            <c:choose>
                                        		<c:when test="${ pageHelper.currentPageIndex == pageHelper.totalPages}">
                                        			<li class="am-disabled"><a href="${pageContext.request.contextPath}/adminGM/merchantsList.shtml?pageIndex=${pageHelper.currentPageIndex+1}&shopName=${shopName}">»</a></li>
                                        		</c:when>
                                        		<c:otherwise>
                                        			<li><a href="${pageContext.request.contextPath}/adminGM/merchantsList.shtml?pageIndex=${pageHelper.currentPageIndex+1}&shopName=${shopName}">»</a></li>
                                        		</c:otherwise>
                                        	</c:choose>
                                            
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <script src="${pageContext.request.contextPath}/assets/js/amazeui.min.js"></script>
    <script src="${pageContext.request.contextPath}/assets/js/app.js"></script>

</body>

</html>